package org.oyrm.kobo.formBuilder.ui;

import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JProgressBar;

public class StatusBar extends JPanel{

	/**
	 * 
	 */
	private static final long serialVersionUID = 8550787909707939663L;
	
	/**
	 * A label
	 */
	private JLabel label = null;
	
	/**
	 * A progress bar, what else do you need to make a status bar.
	 */
	private JProgressBar progressBar = null;
	
	
	/**
	 * Your timeless and classic constructor
	 */
	public StatusBar()
	{
		super();
		createComponents();
		placeComponents();
	}


	/**
	 * Creates my UI components
	 */
	private void createComponents() {
		label = new JLabel();
		label.setAlignmentX(0);
		
		progressBar = new JProgressBar();
		progressBar.setAlignmentX(0);
	}


	/**
	 * Puts the components together.
	 */
	private void placeComponents() {
		
		add(label);
		add(progressBar);		
	}
	
	
	/**
	 * Used to set the text of the status bar label
	 * @param text
	 */
	public void setStatusText(String text)
	{
		label.setText(text);
	}

}
